package com.accenture.adf.newcodington.module9.sample;

/**
 * 
 * LaserShow is about a special show in the New Codington Museum
 *  
 * Topic: Try-it on usage of getter and setter methods
 * 
 * Instructions:
 * 1. Use 'LaserShow_TryIt3' as the starting point and make the following changes
 * 2. Change the class name to 'LaserShow_TryIt4'
 * 		a. Change all references of 'LaserShow_TryIt3' to 'LaserShow_TryIt4' (for example constructors)
 * 3. Create get() and set() methods for each of the non static variables with appropriate parameters and return types after parameterized constructor
 * 4. All set() methods assign parameter values to their respective instance variables
 * 5. All get() methods will have return statement returning current value of the respective instance variable
 * 6. Print all the variable values using the respective get() methods to console inside main() method using 'LaserShow_TryIt4' instance
 * 7. Use any of the get() and set() methods to read / write values for the respective instance variables
 * 
 */


public class LaserShow_TryIt4 {
	
	//Static fields
	private static final String showType;
	private static final String showName;
	
	//Instance variables
	private String name;
	private double duration;
	private int noOfSeats;
	private boolean gogglesRequried;

	static{
		showType = "Animated";
		showName = "LaserShow";
		System.out.println("Static block initialiazed.");
	}
	
	public static void main(String[] args){		
		System.out.println("Show Type: " + showType);
		System.out.println("Show Name: " + showName);
		
		//laserShow - is a local variable
		LaserShow_TryIt4 laserShow1 = new LaserShow_TryIt4("Planets", 2.5, 20, true);
		
		System.out.println();
		System.out.println("Show name: " + laserShow1.getName());
		System.out.println("Show Duration: "+ laserShow1.getDuration());		
		System.out.println("Show seating capacity: "+ laserShow1.getNoOfSeats());
		System.out.println("Goggles Required: "+ laserShow1.isGogglesRequried());
	
		// Try-it 4 - use setter to change the duration
		laserShow1.setDuration(1.5);
		System.out.println("Show duration for "+laserShow1.getName()+ " changed to: "+ laserShow1.getDuration());
		
		LaserShow_TryIt4 laserShow2 = new LaserShow_TryIt4("Dark Side of the Moon", 2.5, 20, true);
		
		System.out.println();
		System.out.println("Show name: " + laserShow2.getName());
		System.out.println("Show Duration: "+ laserShow2.getDuration());		
		System.out.println("Show seating capacity: "+ laserShow2.getNoOfSeats());
		System.out.println("Goggles Required: "+ laserShow2.isGogglesRequried());
	
		// Try-it 4 - use setter to change the seating capacity
		laserShow2.setNoOfSeats(40);
		System.out.println("Show seating capacity for "+laserShow2.getName()+" changed to: "+ laserShow2.getNoOfSeats());
		// end Try-it 4
	}
	
	//Generic constructor
	public LaserShow_TryIt4() {
		System.out.println("Default constructor invoked.");
	}
	
	//Parameterized constructor
	public LaserShow_TryIt4(String name, double duration, int noOfSeats,	boolean gogglesRequried) {
		this.setName(name);
		this.duration = duration;
		this.noOfSeats = noOfSeats;
		this.gogglesRequried = gogglesRequried;
		
		System.out.println("\nParameterized constructor invoked.");
	}
	
	// Try-it 4 - Setter and Getter methods
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	public double getDuration() {
		return duration;
	}

	public void setDuration(double duration) {
		this.duration = duration;
	}

	public int getNoOfSeats() {
		return noOfSeats;
	}

	public void setNoOfSeats(int noOfSeats) {
		this.noOfSeats = noOfSeats;
	}

	public boolean isGogglesRequried() {
		return gogglesRequried;
	}

	public void setGogglesRequried(boolean gogglesRequried) {
		this.gogglesRequried = gogglesRequried;
	}
	// end Try-it 4
	
	
}
